home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 94 / CD-ROM 94.iso / util / weban / setup.msi / Cabs.w23.cab / cmdDetailReport.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-07-09  |  5.8 KB  |  205 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:variable name="Assessment">
  5.     <c score="1" text="Incomplete Scan"/>
  6.     <c score="2" text="Severe Risk"/>
  7.     <c score="3" text="Potential Risk"/>
  8.     <c score="4" text="Security FYIs"/>
  9.     <c score="5" text="Strong Security"/>
  10. </xsl:variable>
  11. <xsl:variable name="CR" select="'
  12. '"/>
  13. <xsl:variable name="FileName" select="'file name here'"></xsl:variable>
  14.     
  15. <xsl:template match="SecScan">
  16.  
  17. <xsl:param name="assess" select="@Grade"/>        
  18. Computer name:<xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  19. IP address:<xsl:value-of select="@IP"/>
  20. Security report name:<xsl:value-of select="$FileName" />
  21. Scan date:<xsl:value-of select="@Date"/>
  22. <xsl:choose><xsl:when test="@HotfixDataVersion">
  23. Security update database version:<xsl:value-of select="@HotfixDataVersion"/></xsl:when></xsl:choose>
  24. Security assessment:<xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/>
  25.  
  26. <xsl:choose>
  27. <xsl:when test="Check[@Type='5']">
  28.  
  29.   Security Update Scan Results
  30.     <xsl:choose>
  31.     <xsl:when test="Check[@Type='5'][@Cat='1']">
  32.             <xsl:for-each select=".">
  33.                 <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  34.                     
  35.                 </xsl:apply-templates>
  36.             </xsl:for-each>
  37.     </xsl:when>
  38.     </xsl:choose>
  39. </xsl:when>
  40. </xsl:choose>
  41. <xsl:choose>
  42. <xsl:when test="Check[@Type='1']">
  43.  
  44.   Operating System Scan Results 
  45.     <xsl:choose>
  46.     <xsl:when test="Check[@Type='1'][@Cat='1']">
  47.     Vulnerabilities 
  48.             <xsl:for-each select=".">
  49.                 <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  50.                     
  51.                 </xsl:apply-templates>
  52.             </xsl:for-each>
  53.     </xsl:when>
  54.     </xsl:choose>
  55.     <xsl:choose>
  56.     <xsl:when test="Check[@Type='1'][@Cat='2']">
  57.     Additional System Information 
  58.         <xsl:for-each select=".">
  59.             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  60.                     
  61.             </xsl:apply-templates>
  62.         </xsl:for-each>
  63.     </xsl:when>
  64.     </xsl:choose>
  65. </xsl:when>
  66. </xsl:choose>
  67. <xsl:choose>
  68. <xsl:when test="Check[@Type='3']">
  69.  
  70.   Internet Information Services (IIS) Scan Results
  71.     <xsl:choose>
  72.     <xsl:when test="Check[@Type='3'][@Cat='1']">
  73.     Vulnerabilities 
  74.             <xsl:for-each select=".">
  75.                 <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">
  76.                     
  77.                 </xsl:apply-templates>
  78.             </xsl:for-each>
  79.     </xsl:when>
  80.     </xsl:choose>
  81.     <xsl:choose>
  82.     <xsl:when test="Check[@Type='3'][@Cat='2']">
  83.     Additional System Information 
  84.         <xsl:for-each select=".">
  85.             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  86.                     
  87.             </xsl:apply-templates>
  88.         </xsl:for-each>
  89.     </xsl:when>
  90.     </xsl:choose>
  91. </xsl:when>
  92. </xsl:choose>
  93.  
  94. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  95. <xsl:choose>
  96.     <xsl:when test="SQLInstance">
  97.  
  98.   SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each>
  99.     </xsl:when>
  100. </xsl:choose>
  101.  
  102. <xsl:choose>
  103. <xsl:when test="Check[@Type='2']">
  104.  
  105.   SQL Server Scan Results 
  106.     <xsl:choose>
  107.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  108.     Vulnerabilities 
  109.             <xsl:for-each select=".">
  110.                 <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  111.                     
  112.                 </xsl:apply-templates>
  113.             </xsl:for-each>
  114.     </xsl:when>
  115.     </xsl:choose>
  116.     <xsl:choose>
  117.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  118.     Additional System Information 
  119.         <xsl:for-each select=".">
  120.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  121.                     
  122.             </xsl:apply-templates>
  123.         </xsl:for-each>
  124.     </xsl:when>
  125.     </xsl:choose>
  126. </xsl:when>
  127. </xsl:choose>
  128.  
  129. <xsl:choose>
  130. <xsl:when test="Check[@Type='4']">
  131.  
  132.   Desktop Application Scan Results 
  133.     <xsl:choose>
  134.     <xsl:when test="Check[@Type='4'][@Cat='1']">
  135.     Vulnerabilities 
  136.             <xsl:for-each select=".">
  137.                 <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  138.                 </xsl:apply-templates>
  139.             </xsl:for-each>
  140.     </xsl:when>
  141.     </xsl:choose>
  142.     <xsl:choose>
  143.     <xsl:when test="Check[@Type='4'][@Cat='2']">
  144.     Additional System Information 
  145.         <xsl:for-each select=".">
  146.             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  147.             </xsl:apply-templates>
  148.         </xsl:for-each>
  149.     </xsl:when>
  150.     </xsl:choose>
  151. </xsl:when>
  152. </xsl:choose>
  153.  
  154. </xsl:template>
  155.     
  156. <!-- SQL Instance section -->
  157. <xsl:template match="SQLInstance">
  158.  
  159.    Instance <xsl:value-of select="@Name"/>
  160.     <xsl:choose>
  161.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  162.  
  163.     Vulnerabilities
  164.         <xsl:for-each select=".">
  165.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  166.             </xsl:apply-templates>
  167.         </xsl:for-each>
  168.     </xsl:when>
  169.     </xsl:choose>
  170.     <xsl:choose>
  171.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  172.  
  173.     Additional System Information
  174.         <xsl:for-each select=".">
  175.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  176.             </xsl:apply-templates>
  177.         </xsl:for-each>
  178.     </xsl:when>
  179.     </xsl:choose>
  180. </xsl:template>
  181.  
  182. <xsl:template match="Check">
  183.  
  184. <xsl:param name="score" select="@Grade"/>
  185.         Issue:  <xsl:value-of select="@Name"/> 
  186.         Score:  <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$score]/@text"/> 
  187.         Result: <xsl:value-of select="Advice"/> 
  188.           <xsl:if test="Detail">
  189.           Detail: <xsl:choose>
  190.             <xsl:when test="@Type='5'">
  191.             | <xsl:for-each select="Detail/Head/Col"><xsl:if test="position()!=last()"><xsl:value-of select="."/> | </xsl:if></xsl:for-each>
  192.             <xsl:for-each select="Detail/Row">
  193.             | <xsl:for-each select="Col"><xsl:if test="position()!=last()"><xsl:value-of select="."/> | </xsl:if></xsl:for-each>
  194.             </xsl:for-each> 
  195.             </xsl:when>
  196.             <xsl:otherwise>
  197.             | <xsl:for-each select="Detail/Head/Col"><xsl:value-of select="."/> | </xsl:for-each>
  198.             <xsl:for-each select="Detail/Row">
  199.             | <xsl:for-each select="Col"><xsl:value-of select="."/> | </xsl:for-each>
  200.             </xsl:for-each> 
  201.             </xsl:otherwise>
  202.             </xsl:choose>
  203.           </xsl:if>
  204. </xsl:template>
  205. </xsl:stylesheet>